#ifndef _CACSIAGENT_H
#define _CACSIAGENT_H
#pragma once
#include <stdio.h>
#include "acsi_class.h"
#include "mtree.h"
#include "acsivar.h"
#include "XmlRW.h"
#include "ServerModel.h"
#include "ServiceGetRCB.h"
#include <QTreeWidgetItem>
class CAcsiAgent: public CAcsi
{

public:
    CAcsiAgent(void);
    virtual  ~CAcsiAgent();
public:
    BOOL AssociateDevice(const char * szAccessPoint, const char * szIpAddr);
    void GetServerModel(QTreeWidgetItem *treeItem);
    BOOL SetXml(const char* filename);
private:
    BOOL OnGetServerDirectory(int iClass, CMTree & tree);
    BOOL OnGetLogicDeviceDirectory(const char * szLDRef, CMTree & tree);
    BOOL OnGetLogicNodeDirectory(const char * szLNRef, int iClass,
                                 CMTree & tree);
    BOOL OnGetDataValues(const char * szDataRef, CMTree & tree);
    BOOL OnGetDataDirectory(const char * szDataRef, CMTree & tree);
    BOOL OnGetDataDefinition(const char * szDataRef, CMTree & tree);
    BOOL OnGetDataSetValues(const char * szDataSetRef, CMTree & tree);
    BOOL OnGetDataSetDirectory(const char * szDataSetRef, CMTree & tree);
    BOOL OnGetBRCB(const char * szBrcbRef, CMTree & tree);
    BOOL OnGetURCB(const char * szUrcbRef, CMTree & tree);
    BOOL OnReport(ReportHead * head, AcsiEntry ** entry, int iEntryNum);
    BOOL OnLog(BOOL bMorefollow, AcsiEntry ** entry, int iEntryNum);
    BOOL OnOperate(OPER_RESULT * oper_result);
    BOOL OnGetFileAttrib(const char * szStrName, CMTree & tree,
                         BOOL morefollow = FALSE);
    BOOL OnGetSGValues(const char * szSGRef, CMTree & tree);
    BOOL OnGetSGCBValues(const char * szSGCBRef, CMTree & tree);
private:
    //CXmlRW *m_ModelXml;
    CServerModel *m_ServerModel;
    CServiceGetRCB *m_ServiceGetRCB;
    BOOL m_DevIsAssociated;
    BOOL m_AppIsConnected;
};

#endif // CACSIAGENT_H
